import type { SourceVO } from '@/types/SourceVO'
import config from '@/database/videoconfig'

export default defineEventHandler(async (event) => {
  const cfg = await useStorage().getItem<SourceVO>('source')
  if(cfg == null) {
    await useStorage<SourceVO>().setItem('source', {
      name: config.name,
      url: config.url,
      jx_url: config.jx_url,
      exclude_channel_ids: config.exclude_channel_ids,
      exclude_video_ids: config.exclude_video_ids
    })
  }
  return await useStorage<SourceVO>().getItem('source')
})
